# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/12/31 15:47
# @File           : urls.py
# @desc           : api router

from apps.vadmin.auth.utils.login import app as auth_app
from apps.vadmin.auth.views import app as vadmin_auth_app
from apps.vadmin.system.views import app as vadmin_system_app
from apps.vadmin.record.views import app as vadmin_record_app
from apps.vadmin.help.views import app as vadmin_help_app
from apps.vadmin.resource.views import app as vadmin_resource_app

from crewplus.apps.apikey.views import app as api_key_app
from crewplus.apps.account.register import app as register_app

from crewplus.apps.rag.knowledge_base import app as knowledge_base_app
from crewplus.apps.rag.document import app as document_app
from crewplus.apps.rag.ingest_document import app as ingest_document_app
from crewplus.apps.rag.graph_index import app as graph_index_app

from crewplus.apps.rag.ontology import app as ontology_app
from crewplus.apps.rag.oschema import app as oschema_app

from crewplus.apps.conversation.conversation import app as conversation_app
from crewplus.apps.rag.knowledge_rag import app as knowledgerag# 自定义新的路由
urlcustoms = [
    {"ApiRouter": register_app, "prefix": "/auth", "tags": ["System Registration"]},
    {"ApiRouter": api_key_app, "prefix": "/crewplus/v2", "tags": ["API KEY Management"]},
    
    {"ApiRouter": knowledge_base_app, "prefix": "/crewplus/v2", "tags": ["CrewPlus Knowledge Base"]},
    {"ApiRouter": document_app, "prefix": "/crewplus/v2", "tags": ["CrewPlus Document"]},
    {"ApiRouter": ingest_document_app, "prefix": "/crewplus/v2", "tags": ["CrewPlus Document Ingestion"]},
    # Include the graph index endpoints
    {"ApiRouter": graph_index_app, "prefix": "/crewplus/v2", "tags": ["CrewPlus Graph Index Management"]},
    
    {"ApiRouter": ontology_app, "prefix": "/crewplus/v2", "tags": ["CrewPlus Ontology"]},
    {"ApiRouter": oschema_app, "prefix": "/crewplus/v2", "tags": ["CrewPlus Domain Schema"]},
    {"ApiRouter": knowledgerag, "prefix": "/crewplus/v2", "tags": ["CrewPlus RAG"]},
    {"ApiRouter": conversation_app, "prefix": "/crewplus/v2", "tags": ["CrewPlus Conversations"]},
]

# 引入应用中的路由
urlpatterns = urlcustoms + [
    {"ApiRouter": auth_app, "prefix": "/auth", "tags": ["Authentication"]},
    {"ApiRouter": vadmin_auth_app, "prefix": "/vadmin/auth", "tags": ["Admin Auth"]},
    {"ApiRouter": vadmin_system_app, "prefix": "/vadmin/system", "tags": ["System Management"]},
    {"ApiRouter": vadmin_record_app, "prefix": "/vadmin/record", "tags": ["Record Management"]},
    {"ApiRouter": vadmin_help_app, "prefix": "/vadmin/help", "tags": ["Help Documentation"]},
    {"ApiRouter": vadmin_resource_app, "prefix": "/vadmin/resource", "tags": ["Resource Management"]},
]
